<?php


namespace app\admin\validate;

class CouponValidate extends BaseValidate
{
    protected $rule = [
        'title' => 'require',
        'money' => 'require|isFloatOrPositiveInteger',
        'restrict' => 'require|isPositiveIntegerOrZero',
        'num' => 'require|isPositiveIntegerOrZero',
        'is_permanent_validity' => 'require|in:1,0'
    ];

    protected $message = [
        'title.require' => '请输入配置名称',
        'money.require' => '请输入优惠金额',
        'money.isFloatOrPositiveInteger' => '请输入优惠金额',
        'restrict.require' => '请输入满减限制',
        'restrict.isPositiveIntegerOrZero' => '请输入满减限制',
        'num.require' => '请输入发放数量',
        'num.isPositiveIntegerOrZero' => '请输入发放数量',
        'is_permanent_validity.require' => '请选择是否永久有效',
        'is_permanent_validity.in' => '请选择是否永久有效',
    ];
}